﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FacultyImplementation
{
    class Department
    {
        public string departmentName;
        public string firstNameHeadOfDepartment;
        public string lastNameHeadOfDepartment;

        List<Group> groupsList = new List<Group>();

        public void AddDepartmentInfo()
        {
            Console.Write("Enter department name: ");
            departmentName = Console.ReadLine();
            Console.Write("Enter first name head of department: ");
            firstNameHeadOfDepartment = Console.ReadLine();
            Console.Write("Enter last name head of department: ");
            lastNameHeadOfDepartment = Console.ReadLine();
        }

        public void AddGroupsToDepartment()
        {
            string select = "N";
            do
            {
                Console.WriteLine("-----Group adding-----");
                Group group = new Group();
                group.AddGroupInfo();
                group.AddStudentsToGroup();
                groupsList.Add(group);
                Console.WriteLine("Continue group adding? Y/N");
                select = Console.ReadLine().ToUpper();
            }
            while (select == "Y");
        }

        public void DepartmentShowInfo()
        {
            Console.WriteLine();
            Console.WriteLine("Department name: {0}", departmentName);
            Console.WriteLine("Head of department: {0} {1}", firstNameHeadOfDepartment, lastNameHeadOfDepartment);
            foreach (var groups in groupsList)
            {
                groups.GroupShowInfo();
            }
        }

        public void OnlyDepartmentNameShowInfo()
        {
            Console.WriteLine();
            Console.WriteLine("Department name: {0}", departmentName);
            Console.WriteLine("Head of department: {0} {1}", firstNameHeadOfDepartment, lastNameHeadOfDepartment);
        }

        public void OnlyStudentsShowInfo()
        {
            foreach(var student in groupsList)
            {
                student.GroupShowInfo();
            }
        }
    }
}
